﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class select : MonoBehaviour
{
    private UIPopupList uIPopupList;

    // Start is called before the first frame update
    void Start()
    {

        uIPopupList = this.GetComponent<UIPopupList>();
        uIPopupList.onChange.Add(new EventDelegate(OnValueSelect));
       
    }
    public void OnValueSelect()
    {
        print(uIPopupList.value);
        switch (uIPopupList.value)
        {
            case "first":
                {
                    SceneManager.LoadScene(1);
                }
                break;
            case "Second":
                {
                    SceneManager.LoadScene(0); 
                }
                break;
            case "third":
                {
                    SceneManager.LoadScene(0);
                }
                break;
            case "fourth":
                {
                    SceneManager.LoadScene(0);
                }
                break;
            default:
                break;
        }
    }
    
}
